package error.虚拟机栈和本地方法栈溢出;

public class MxStackOverflow {

    private int length = 1;

    public void stackLeak() {
        length++;
        stackLeak();
    }

    public static void main(String[] args) {
        MxStackOverflow m = new MxStackOverflow();
        try {
            m.stackLeak();
        } catch (Throwable e) {
            System.out.println("length: " + m.length);
            throw e;
        }
    }
}
